<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Rental and Housing Information</title>
</head>
<body>
<%@ page import="zillow.api.results.Zillow"%>
<%@ page import="zillow.api.results.LongLatService" %>

<jsp:useBean id="cb" scope="request" class="zillow.api.results.Zillow" />
<jsp:setProperty name="cb" property="*" />
<%@ page import="java.util.StringTokenizer" %>
<h2 style="text-align:left;">Various Housing Details<br /></h2>
	 <%
	 
	 Zillow validation = new Zillow();
	 String address = request.getParameter("address");
	 StringTokenizer st = new StringTokenizer(address, ",");
	 String street = st.nextToken();
	 String city = st.nextToken();
	 String state = st.nextToken();
	 String citystate = city+" "+state;
       
	 String result = validation.getValuation(street, citystate);
	// StringTokenizer st = new StringTokenizer(str);
	if (result.equals("Error: no exact match found for input address"))
	{
	out.println("Results not found");
	}
	else
	{
	 StringTokenizer st2 = new StringTokenizer(result, ",");
	 String year = st2.nextToken();
		out.println(year);
		%>
		<br>
		 <%
			String sqr = st2.nextToken();
			out.println(sqr); %>
			<br>
					 <%
			String bat = st2.nextToken();
			out.println(bat); %>
			<br>
					 <%
			String bed = st2.nextToken();
			out.println(bed); %>
			<br>
	 <%
			String res = st2.nextToken();
			out.println(res); %>
		<br>	<% 
			out.println();
			String over = st2.nextToken();
			out.println(over);
	 %>
	 	<br>	
	 	<% 
			out.println();
			String over2 = st2.nextToken();
			out.println(over2);
	 %>
	 	 	<br>	
	 	<% 
			out.println();
			String over3 = st2.nextToken();
			out.println(over3);
	 %>
	 	<br><% 
			out.println();
			String over1 = st2.nextToken();
			out.println(over1);
	}
	 %>
	 <br>
	
	 
</body>
</html>